<!DOCTYPE html>
<html>
<head>
  <title>Apsoo</title>
  <%= stylesheet_link_tag    "application", :media => "all" %>
  <%= javascript_include_tag "application" %>
  <%= csrf_meta_tags %>
</head>
<body>

<div id = "top_nav">
  <div class = "upper_right_menu">
  	<% if current_user %>
      Autenticado como <%= link_to current_user.login, current_user %> | 
      <%= link_to "Sair", log_out_path %>
    <% else %>
      <%= link_to "Entrar", log_in_path %>
    <% end %>
  </div>
  <div class = 'upper_left_menu'>
      <%= link_to 'Home', root_url %>
      <% if current_user %>
        <%= link_to "Servicos", servicos_path %>
        <% if current_user.type != "Hospede" %>
          <%= link_to "Reservas", reservas_path %>
          <%= link_to "Usuarios", usuarios_path %>
          <%= link_to "Hospedagens", hospedagems_path %>
          <% if current_user.type == "Gerente" || current_user.type == "Admin" %>
            <%= link_to "Consultas", consultas_path %>
          <% end %>
        <% elsif Hospede.find(current_user.id).hospedagem_atual %>
          <%= link_to "Hospedagem", Hospede.find(current_user.id).hospedagem_atual %>
        <% end %>
      <% end %>
  </div>
</div>

<div id = 'flashes'>
  <% flash.each do |name, msg| %>
      <%= content_tag :div, msg, :id => "flash#{name}" %>
  <% end %>
</div>

<div id = 'content'>
  <%= yield %>
</div>

</body>
</html>
